<template>
    <div class="formSixConstainer">
        <h1 style="text-align:center">银行及相关金融业资产负债及损益表</h1>
        <div style="float:right">
                <p>表号：711—6表</p>
                <p>制定机关：国家统计局国务院经济普查办公室</p>
                <p>文号：国统字（2018）号</p>
                <p>有效期至：2019年6月</p>
            </div>
            <div style="margin-top:25px;">
                <p>组织机构代码:&nbsp;{{organizationCode}}</p>
                <p>统一社会信用代码:&nbsp;{{socialCreditCode}}</p>
                <p>单位详细名称:&nbsp;{{unitDetailedName}}</p>
            </div>
        <div>
            <el-form :model="formData" :rules="rules" ref="formData" label-width="100px" class="demo-ruleForm">
                <table class="formsixTable">
                    <tr>
                        <td>指标名称</td><td>计量单位</td><td>代码</td><td>本年实际</td>
                    </tr>
                    <tr>
                        <td>甲</td><td>乙</td><td>丙</td><td>1</td>
                    </tr>
                    <tr>
                        <td>一、资产负债</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="assetLiability" class="formSixDataInt">
                                <el-input v-model="formData.assetLiability"  @keyup.native="test(formData.assetLiability,'assetLiability')"></el-input>
                                <div class="red" v-show="saveData.assetLiability">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">固定资产原价 </td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="fixedAssets" class="formSixDataInt">
                                <el-input v-model="formData.fixedAssets"  @keyup.native="test(formData.fixedAssets,'fixedAssets')"></el-input>
                                <div class="red" v-show="saveData.fixedAssets">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:74px">其中：房屋和构筑物</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="housesStructures" class="formSixDataInt">
                                <el-input v-model="formData.housesStructures"  @keyup.native="test(formData.housesStructures,'housesStructures')"></el-input>
                                <div class="red" v-show="saveData.housesStructures">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:123px">机器设备</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="machineryEquipment" class="formSixDataInt">
                                <el-input v-model="formData.machineryEquipment"  @keyup.native="test(formData.machineryEquipment,'machineryEquipment')"></el-input>
                                <div class="red" v-show="saveData.machineryEquipment">请输入小数点后5位至小数点前20位之间的数字</div>
                                
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:123px">运输工具</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="conveyance" class="formSixDataInt">
                                <el-input v-model="formData.conveyance"   @keyup.native="test(formData.conveyance,'conveyance')"></el-input>
                                <div class="red" v-show="saveData.conveyance">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">累计折旧千元</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="totalDepreciation" class="formSixDataInt">
                                <el-input v-model="formData.totalDepreciation"   @keyup.native="test(formData.totalDepreciation,'totalDepreciation')"></el-input>
                                <div class="red" v-show="saveData.totalDepreciation">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">本年折旧</td><td>千元</td><td></td>
                        <td>
                             <el-form-item prop="thisYearDepreciation" class="formSixDataInt">
                                <el-input v-model="formData.thisYearDepreciation"  @keyup.native="test(formData.thisYearDepreciation,'thisYearDepreciation')"></el-input>
                                <div class="red" v-show="saveData.thisYearDepreciation">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">无形资产原价</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="intangibleAssets" class="formSixDataInt">
                                <el-input v-model="formData.intangibleAssets"   @keyup.native="test(formData.intangibleAssets,'intangibleAssets')"></el-input>
                                <div class="red" v-show="saveData.intangibleAssets">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:72px">其中：土地使用权</td><td>千元</td><td></td>
                        <td>
                             <el-form-item prop="landUseRight" class="formSixDataInt">
                                <el-input v-model="formData.landUseRight"   @keyup.native="test(formData.landUseRight,'landUseRight')"></el-input>
                                <div class="red" v-show="saveData.landUseRight">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">资产总计</td><td>千元</td><td></td>
                        <td>
                             <el-form-item prop="totalAssets" class="formSixDataInt">
                                <el-input v-model="formData.totalAssets"  @keyup.native="test(formData.totalAssets,'totalAssets')"></el-input>
                                <div class="red" v-show="saveData.totalAssets">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">负债合计</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="totalDebt" class="formSixDataInt">
                                <el-input v-model="formData.totalDebt"   @keyup.native="test(formData.totalDebt,'totalDebt')"></el-input>
                                <div class="red" v-show="saveData.totalDebt">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">实收资本</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="capitalCollection" class="formSixDataInt">
                                <el-input v-model="formData.capitalCollection"   @keyup.native="test(formData.capitalCollection,'capitalCollection')"></el-input>
                                <div class="red" v-show="saveData.capitalCollection">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td>二、损益</td><td>千元</td><td></td>
                        <td>
                             <el-form-item prop="profitLoss" class="formSixDataInt">
                                <el-input v-model="formData.profitLoss"   @keyup.native="test(formData.profitLoss,'profitLoss')"></el-input>
                                <div class="red" v-show="saveData.profitLoss">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">营业收入</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="businessIncome" class="formSixDataInt">
                                <el-input v-model="formData.businessIncome"  @keyup.native="test(formData.businessIncome,'businessIncome')"></el-input>
                                <div class="red" v-show="saveData.businessIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:72px">其中：利息收入 </td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="interestIncome" class="formSixDataInt">
                                <el-input v-model="formData.interestIncome"   @keyup.native="test(formData.interestIncome,'interestIncome')"></el-input>
                                <div class="red" v-show="saveData.interestIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:136px">其中：金融机构往来利息收入</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="interestRateIncome" class="formSixDataInt">
                                <el-input v-model="formData.interestRateIncome"   @keyup.native="test(formData.interestRateIncome,'interestRateIncome')"></el-input>
                                <div class="red" v-show="saveData.interestRateIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:185px">各项贷款利息收入</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="loanInterestIncome" class="formSixDataInt">
                                <el-input v-model="formData.loanInterestIncome"  @keyup.native="test(formData.loanInterestIncome,'loanInterestIncome')"></el-input>
                                <div class="red" v-show="saveData.loanInterestIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:120px">利息支出</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="interestExpenditure" class="formSixDataInt">
                                <el-input v-model="formData.interestExpenditure"   @keyup.native="test(formData.interestExpenditure,'interestExpenditure')"></el-input>
                                <div class="red" v-show="saveData.interestExpenditure">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:136px">其中：金融机构往来利息支出</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="interestRateExpenditure" class="formSixDataInt">
                                <el-input v-model="formData.interestRateExpenditure"   @keyup.native="test(formData.interestRateExpenditure,'interestRateExpenditure')"></el-input>
                                <div class="red" v-show="saveData.interestRateExpenditure">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                            </td>
                    </tr>
                    <tr>
                        <td style="padding-left:185px">各项存款利息支出</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="loanInterestExpenditure" class="formSixDataInt">
                                <el-input v-model="formData.loanInterestExpenditure"   @keyup.native="test(formData.loanInterestExpenditure,'loanInterestExpenditure')"></el-input>
                                <div class="red" v-show="saveData.loanInterestExpenditure">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:120px">手续费收入</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="serviceFeeIncome" class="formSixDataInt">
                                <el-input v-model="formData.serviceFeeIncome"   @keyup.native="test(formData.serviceFeeIncome,'serviceFeeIncome')"></el-input>
                                <div class="red" v-show="saveData.serviceFeeIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:120px">手续费支出</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="serviceFeeExpenditure" class="formSixDataInt">
                                <el-input v-model="formData.serviceFeeExpenditure"   @keyup.native="test(formData.serviceFeeExpenditure,'serviceFeeExpenditure')"></el-input>
                                <div class="red" v-show="saveData.serviceFeeExpenditure">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:120px">租赁收益</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="rentalIncome" class="formSixDataInt">
                                <el-input v-model="formData.rentalIncome"   @keyup.native="test(formData.rentalIncome,'rentalIncome')"></el-input>
                                <div class="red" v-show="saveData.rentalIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:120px">投资收益</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="investmentIncome" class="formSixDataInt">
                                <el-input v-model="formData.investmentIncome"   @keyup.native="test(formData.investmentIncome,'investmentIncome')"></el-input>
                                <div class="red" v-show="saveData.investmentIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:120px">公允价值变动收益</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="fairValueGain" class="formSixDataInt">
                                <el-input v-model="formData.fairValueGain"   @keyup.native="test(formData.fairValueGain,'fairValueGain')"></el-input>
                                <div class="red" v-show="saveData.fairValueGain">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:120px">汇兑净收益千元</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="netReturn" class="formSixDataInt">
                                <el-input v-model="formData.netReturn"   @keyup.native="test(formData.netReturn,'netReturn')"></el-input>
                                <div class="red" v-show="saveData.netReturn">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:120px">其他业务收入</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="otherBusinessIncome" class="formSixDataInt">
                                <el-input v-model="formData.otherBusinessIncome"   @keyup.native="test(formData.otherBusinessIncome,'otherBusinessIncome')"></el-input>
                                <div class="red" v-show="saveData.otherBusinessIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">营业支出</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="operatingExpenses" class="formSixDataInt">
                                <el-input v-model="formData.operatingExpenses"  @keyup.native="test(formData.operatingExpenses,'operatingExpenses')"></el-input>
                                <div class="red" v-show="saveData.operatingExpenses">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:72px">其中：业务及管理费</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="managementCost" class="formSixDataInt">
                                <el-input v-model="formData.managementCost"  @keyup.native="test(formData.managementCost,'managementCost')"></el-input>
                                <div class="red" v-show="saveData.managementCost">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:138px">其中：职工工资</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="workerSalary" class="formSixDataInt">
                                <el-input v-model="formData.workerSalary"   @keyup.native="test(formData.workerSalary,'workerSalary')"></el-input>
                                <div class="red" v-show="saveData.workerSalary">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:185px">福利费 </td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="welfareFunds" class="formSixDataInt">
                                <el-input v-model="formData.welfareFunds"  @keyup.native="test(formData.welfareFunds,'welfareFunds')"></el-input>
                                <div class="red" v-show="saveData.welfareFunds">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:185px">住房公积金和住房补贴</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="workerAllowances" class="formSixDataInt">
                                <el-input v-model="formData.workerAllowances"  @keyup.native="test(formData.workerAllowances,'workerAllowances')"></el-input>
                                <div class="red" v-show="saveData.workerAllowances">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:118px">营业税金及附加</td><td>千元</td><td></td>
                        <td>
                              <el-form-item prop="taxation" class="formSixDataInt">
                                <el-input v-model="formData.taxation"  @keyup.native="test(formData.taxation,'taxation')"></el-input>
                                <div class="red" v-show="saveData.taxation">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:118px">资产减值损失 </td><td>千元</td><td></td>
                        <td>
                             <el-form-item prop="assetsImpairmentLoss" class="formSixDataInt">
                                <el-input v-model="formData.assetsImpairmentLoss"  @keyup.native="test(formData.assetsImpairmentLoss,'assetsImpairmentLoss')"></el-input>
                                <div class="red" v-show="saveData.assetsImpairmentLoss">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:118px">其他业务支出</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="otherBusinessExpenditure" class="formSixDataInt">
                                <el-input v-model="formData.otherBusinessExpenditure"   @keyup.native="test(formData.otherBusinessExpenditure,'otherBusinessExpenditure')"></el-input>
                                <div class="red" v-show="saveData.otherBusinessExpenditure">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">营业利润</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="operatingProfit" class="formSixDataInt">
                                <el-input v-model="formData.operatingProfit"  @keyup.native="test(formData.operatingProfit,'operatingProfit')"></el-input>
                                <div class="red" v-show="saveData.operatingProfit">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">营业外收入</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="outsideIncome" class="formSixDataInt">
                                <el-input v-model="formData.outsideIncome"   @keyup.native="test(formData.outsideIncome,'outsideIncome')"></el-input>
                                <div class="red" v-show="saveData.outsideIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:70px">其中：补贴收入</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="subsidizedIncome" class="formSixDataInt">
                                <el-input v-model="formData.subsidizedIncome"  @keyup.native="test(formData.subsidizedIncome,'subsidizedIncome')"></el-input>
                                <div class="red" v-show="saveData.subsidizedIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">营业外支出</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="outsideExpenditure" class="formSixDataInt">
                                <el-input v-model="formData.outsideExpenditure"  @keyup.native="test(formData.outsideExpenditure,'outsideExpenditure')"></el-input>
                                <div class="red" v-show="saveData.outsideExpenditure">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:37px">利润总额</td><td>千元</td><td></td>
                        <td>
                            <el-form-item prop="totalProfit" class="formSixDataInt">
                                <el-input v-model="formData.totalProfit"   @keyup.native="test(formData.totalProfit,'totalProfit')"></el-input>
                                <div class="red" v-show="saveData.totalProfit">请输入小数点后5位至小数点前20位之间的数字</div>
                            </el-form-item>
                        </td>
                    </tr>
                </table>
                <div>
                    <el-form-item label="单位负责人："  class="formSixFooter">
                        <el-input v-model="formData.unitHead"></el-input>
                    </el-form-item>
                    <el-form-item label="统计负责人："  class="formSixFooter">
                        <el-input v-model="formData.statisticalControlOfficer"></el-input>
                    </el-form-item>
                    <el-form-item label="填表人："  class="formSixFooter">
                        <el-input v-model="formData.fillFormBy"></el-input>
                    </el-form-item>
                    <el-form-item label="联系电话："  class="formSixFooter">
                        <el-input v-model="formData.phone"></el-input>
                    </el-form-item>
                    <el-form-item label="报出日期："  class="formSixFooter">
                        <el-date-picker type="date" placeholder="选择日期" v-model="formData.updateTime" style="width: 100%;"></el-date-picker>
                    </el-form-item>
                </div>
                <div>
                    说明：<p>1.统计范围：辖区内金融部门负责的单位以外的货币金融服务及其他金融业法人单位。</p>
                    <p>2.报送日期及方式：2019年4月30日前通过非一套表单位采集处理软件或手持电子终端设备采集数据。</p>
                </div>
                <el-form-item style="text-align:center;">
                    <div style="margin-top:20px;width:100%;">
                        <el-button @click="temporarySave('formData')" type="primary">暂存</el-button>
                        <el-button @click="submitFormSix('formData')" type="success">提交</el-button>
                        <el-button type="danger" @click="download">下载PDF表格</el-button>
                    </div>
                </el-form-item>
            </el-form>    
        </div>
       
    </div>
</template>
<script>
export default {
    data(){
        // var validatePass = (rule, value, callback) => {
        //     let reg = /^(\d{1,11})+([.]{1}[0-9]{0,5})?$/;
        //     if (!reg.test(value)) {
        //     callback(new Error('请输入密码'));
        //     } else {
        //     callback();
        //     }
        // };
        return{
            organizationCode:this.$store.get("organizationCode"),
            socialCreditCode:this.$store.get("socialCreditCode"),
            unitDetailedName:this.$store.get("unitDetailedName"),
            rules:{},
            id:null,
            verify:true,
            formData:{
                assetLiability:'',//一、资产负债
                fixedAssets:'',//固定资产原价 
                housesStructures:'',//其中：房屋和构筑物
                machineryEquipment:'',//机器设备
                conveyance:'',//运输工具
                totalDepreciation:'',//累计折旧千元
                thisYearDepreciation:'',//本年折旧
                intangibleAssets:'',//无形资产原价
                landUseRight:'',//其中：土地使用权
                totalAssets:'',//资产总计
                totalDebt:'',//负债合计
                capitalCollection:'',//实收资本
                profitLoss:'',//损益
                businessIncome:'',//营业收入
                interestIncome:'',//利息收入 
                interestRateIncome:'',//其中：金融机构往来利息收入
                loanInterestIncome:'',//各项贷款利息收入
                interestExpenditure:'',//利息支出
                interestRateExpenditure:'',//其中：金融机构往来利息支出
                loanInterestExpenditure:'',//各项存款利息支出
                serviceFeeIncome:'',//手续费收入
                serviceFeeExpenditure:'',//手续费支出
                rentalIncome:'',//租赁收益
                investmentIncome:'',//投资收益
                fairValueGain:'',//公允价值变动收益
                netReturn:'',//汇兑净收益千元
                otherBusinessIncome:'',//其他业务收入
                operatingExpenses:'',//营业支出
                managementCost:'',//其中：业务及管理费
                workerSalary:'',//其中：职工工资
                welfareFunds:'',//福利费 
                workerAllowances:'',//住房公积金和住房补贴
                taxation:'',//营业税金及附加
                assetsImpairmentLoss:'',//资产减值损失 
                otherBusinessExpenditure:'',//其他业务支出
                operatingProfit:'',//营业利润
                outsideIncome:'',//营业外收入
                subsidizedIncome:'',//其中：补贴收入
                outsideExpenditure:'',//营业外支出
                totalProfit:'',//利润总额
                unitHead:'',//单位负责人
                statisticalControlOfficer:'',//统计负责人
                fillFormBy:'',//填表人
                phone:'',//联系电话
                updateTime:'',//报出日期
            },
            saveData:{//暂存判断
                assetLiability:false,//一、资产负债
                fixedAssets:false,//固定资产原价 
                housesStructures:false,//其中：房屋和构筑物
                machineryEquipment:false,//机器设备
                conveyance:false,//运输工具
                totalDepreciation:false,//累计折旧千元
                thisYearDepreciation:false,//本年折旧
                intangibleAssets:false,//无形资产原价
                landUseRight:false,//其中：土地使用权
                totalAssets:false,//资产总计
                totalDebt:false,//负债合计
                capitalCollection:false,//实收资本
                profitLoss:false,//损益
                businessIncome:false,//营业收入
                interestIncome:false,//利息收入 
                interestRateIncome:false,//其中：金融机构往来利息收入
                loanInterestIncome:false,//各项贷款利息收入
                interestExpenditure:false,//利息支出
                interestRateExpenditure:false,//其中：金融机构往来利息支出
                loanInterestExpenditure:false,//各项存款利息支出
                serviceFeeIncome:false,//手续费收入
                serviceFeeExpenditure:false,//手续费支出
                rentalIncome:false,//租赁收益
                investmentIncome:false,//投资收益
                fairValueGain:false,//公允价值变动收益
                netReturn:false,//汇兑净收益千元
                otherBusinessIncome:false,//其他业务收入
                operatingExpenses:false,//营业支出
                managementCost:false,//其中：业务及管理费
                workerSalary:false,//其中：职工工资
                welfareFunds:false,//福利费 
                workerAllowances:false,//住房公积金和住房补贴
                taxation:false,//营业税金及附加
                assetsImpairmentLoss:false,//资产减值损失 
                otherBusinessExpenditure:false,//其他业务支出
                operatingProfit:false,//营业利润
                outsideIncome:false,//营业外收入
                subsidizedIncome:false,//其中：补贴收入
                outsideExpenditure:false,//营业外支出
                totalProfit:false,//利润总额
            },
             rules: {
                assetLiability: [
                    { required: true, message: '请输入资产负债', trigger: 'none' },
                ],
                fixedAssets: [
                    { required: true, message: '请输入固定资产原价', trigger: 'none' },
                ],
                housesStructures: [
                    { required: true, message: '请输入房屋和构筑物', trigger: 'none' },
                ],
                machineryEquipment: [
                    { required: true, message: '请输入机器设备', trigger: 'none' },
                ],
                conveyance: [
                    { required: true, message: '请输入运输工具', trigger: 'none' },
                ],
                totalDepreciation: [
                    { required: true, message: '请输入累计折旧千元', trigger: 'none' },
                ],
                thisYearDepreciation: [
                    { required: true, message: '请输入本年折旧', trigger: 'none' },
                ],
                intangibleAssets: [
                    { required: true, message: '请输入无形资产原价', trigger: 'none' },
                ],
                landUseRight: [
                    { required: true, message: '请输入土地使用权', trigger: 'none' },
                ],
                totalAssets: [
                    { required: true, message: '请输入资产总计', trigger: 'none' },
                ],
                totalDebt: [
                    { required: true, message: '请输入负债合计', trigger: 'none' },
                ],
                capitalCollection: [
                    { required: true, message: '请输入实收资本', trigger: 'none' },
                ],
                profitLoss: [
                    { required: true, message: '请输入损益', trigger: 'none' },
                ],
                businessIncome: [
                    { required: true, message: '请输入营业收入', trigger: 'none' },
                ],
                interestIncome: [
                    { required: true, message: '请输入利息收入', trigger: 'none' },
                ],
                interestRateIncome: [
                    { required: true, message: '请输入金融机构往来利息收入', trigger: 'none' },
                ],
                loanInterestIncome: [
                    { required: true, message: '请输入各项贷款利息收入', trigger: 'none' },
                ],
                interestExpenditure: [
                    { required: true, message: '请输入利息支出', trigger: 'none' },
                ],
                interestRateExpenditure: [
                    { required: true, message: '请输入金融机构往来利息支出', trigger: 'none' },
                ],
                loanInterestExpenditure: [
                    { required: true, message: '请输入各项存款利息支出', trigger: 'none' },
                ],
                serviceFeeIncome: [
                    { required: true, message: '请输入手续费收入', trigger: 'none' },
                ],
                serviceFeeExpenditure: [
                    { required: true, message: '请输入手续费支出', trigger: 'none' },
                ],
                rentalIncome: [
                    { required: true, message: '请输入租赁收益', trigger: 'none' },
                ],
                investmentIncome: [
                    { required: true, message: '请输入投资收益', trigger: 'none' },
                ],
                fairValueGain: [
                    { required: true, message: '请输入公允价值变动收益', trigger: 'none' },
                ],
                netReturn: [
                    { required: true, message: '请输入汇兑净收益千元', trigger: 'none' },
                ],
                otherBusinessIncome: [
                    { required: true, message: '请输入其他业务收入', trigger: 'none' },
                ],
                operatingExpenses: [
                    { required: true, message: '请输入营业支出', trigger: 'none' },
                ],
                managementCost: [
                    { required: true, message: '请输入业务及管理费', trigger: 'none' },
                ],
                workerSalary: [
                    { required: true, message: '请输入职工工资', trigger: 'none' },
                ],
                welfareFunds: [
                    { required: true, message: '请输入福利费', trigger: 'none' },
                ],
                workerAllowances: [
                    { required: true, message: '请输入住房公积金和住房补贴', trigger: 'none' },
                ],
                taxation: [
                    { required: true, message: '请输入营业税金及附加', trigger: 'none' },
                ],
                assetsImpairmentLoss: [
                    { required: true, message: '请输入资产减值损失', trigger: 'none' },
                ],
                otherBusinessExpenditure: [
                    { required: true, message: '请输入其他业务支出', trigger: 'none' },
                ],
                operatingProfit: [
                    { required: true, message: '请输入营业利润', trigger: 'none' },
                ],
                outsideIncome: [
                    { required: true, message: '请输入营业外收入', trigger: 'none' },
                ],
                subsidizedIncome: [
                    { required: true, message: '请输入补贴收入', trigger: 'none' },
                ],
                outsideExpenditure: [
                    { required: true, message: '请输入营业外支出', trigger: 'none' },
                ],
                totalProfit: [
                    { required: true, message: '请输入利润总额', trigger: 'none' },
                ],
             },
        }
    },
    mounted:function(){
        this.getDate();
    },
    methods:{
        //获取数据
        getDate(){
            let self = this;
            let baseID = this.$store.get("companyId");
            console.log(baseID);
            this.$http({
                method:'get',
                url:'711Six/select?baseId='+baseID,
            }).then(function(res){
                console.log(res);
                console.log(res.data.length);
                if(res.status === 200){
                    if(res.data.status===401){
                        self.$message.error("请先登录！");
                        self.$router.push({ path: '/' });
                        return;
                    }
                    if(res.data.length === 0){
                        self.id =null;
                    }else{
                        self.formData = res.data[0];
                        self.id = res.data[0].id;
                        // self.unitHead = res.data[0].unitHead;
                        // self.statisticalControlOfficer = res.data[0].statisticalControlOfficer;
                        // self.fillFormBy = res.data[0].fillFormBy;
                        // self.phone = res.data[0].phone;
                        // self.updateTime = res.data[0].updateTime;
                    }
                }else{
                    self.$message.error(res.message);
                }
            }).catch(function(err){
                console.log("111222");
                console.log(err)
            })
        },
        //提交
        submitFormSix(formName){
            for(var k in this.saveData){
                if(this.saveData[k] === true){
                    return;
                }
            }
            this.$refs[formName].validate((valid) => {
            if (valid) {
                console.log('提交');
                let self = this;
                let data = {};
                data = this.formData;
                //let data = this.formData;
                data.baseId = this.$store.get("companyId");
                data.id = this.id;
                data.state = 1;
                console.log(data);
                //提交请求
                this.$http({
                    method:'post',
                    url:'/711Six/submission',
                    data:data,
                }).then(function(res){
                    console.log(res);
                    console.log("发送ajax");
                    if(res.status === 200){
                        self.$message.success(res.data.message);
                        // for(var d in self.formData){
                        //         for(var r in res.data.data){
                        //             if(d === r){
                        //                 self.formData[d] = res.data.data[r];
                        //             }
                        //         }
                        //     }
                            //self.formData = res.data[0];
                            self.id = res.data.data.id;
                            // self.unitHead = res.data.data.unitHead;
                            // self.statisticalControlOfficer = res.data.data.statisticalControlOfficer;
                            // self.fillFormBy = res.data.data.fillFormBy;
                            // self.phone = rres.data.data.phone;
                            // self.updateTime = res.data.data.updateTime;
                        self.formData = res.data.data;
                        //self.formData.updateTime = res.data.data.newupdateTime;
                        self.$router.push({ path: '/home' })
                    }else{
                        self.$message.error(res.data.message);
                    }
                }).catch(function(err){
                    console.log(err)
                })
                console.log("可以提交");
            } else {
                return false;
            }
            });
            // let reg = /^(\d{1,11})+([.]{1}[0-9]{0,5})?$/;
            // for(var k in this.formData){
            //     console.log(this.formData);
            //     console.log(this.formData[k]);
            //     if(!this.formData[k]){
            //         for(var n in this.submitData){
            //             if(k === n){
            //                 this.submitData[n] = true;
            //             }
            //         }
            //         return;
            //     }else if(!reg.test(this.formData[k])){
            //         for(var m in this.saveData){
            //             if(k === m){
            //                 this.saveData[m] = true;
            //             }
            //         }
            //         return;
            //     }
            //     console.log("233333333");
            // }
           
        },
        //暂存
        temporarySave(formName){
            for(var k in this.saveData){
                if(this.saveData[k] === true){
                    return;
                }
            }
            // let reg = /^(\d{1,11})+([.]{1}[0-9]{0,5})?$/;
            //  for(var k in this.formData){
            //     console.log(this.formData[k]);
            //     if(this.formData[k]){
            //         if(!reg.test(this.formData[k])){
            //         for(var n in this.saveData){
            //             if(k === n){
            //                 this.saveData[n] = true;
            //             }
            //         }
            //         return;
            //     }
            //     }
                
            // }
              console.log('提交');
                let self = this;
                let data = this.formData;
                data.baseId = this.$store.get("companyId");
                data.id = this.id;
                data.state = 0;
                console.log(data);
                console.log(this.rules);
                this.$http({
                    method:'post',
                    url:'/711Six/submission',
                    data:data,
                }).then(function(res){
                    console.log(res);
                    if(res.status === 200){
                        self.$message.success(res.data.message);
                        console.log(self.formData);
                        for(var d in self.formData){
                            for(var r in res.data.data){
                                if(d === r){
                                    self.formData[d] = res.data.data[r];
                                }
                            }
                        }
                        //self.formData = res.data[0];
                        self.id = res.data.data.id;
                        // self.unitHead = res.data.data.unitHead;
                        // self.statisticalControlOfficer = res.data.data.statisticalControlOfficer;
                        // self.fillFormBy = res.data.data.fillFormBy;
                        // self.phone = rres.data.data.phone;
                        // self.updateTime = res.data.data.updateTime;
                        console.log(self.formData);
                        self.formData = res.data.data;
                        //self.formData.updateTime = res.data.data.newupdateTime;
                        self.$router.push({ path: '/home' })
                    }else{
                        self.$message.error(res.data.message);
                    }
                }).catch(function(err){
                    console.log(err)
                })
        },
        //验证文本框输入
        test(value,data){
           let reg =  /^(\-|\+?)\d{1,15}(\.\d{1,5})?$/;
            if(!reg.test(value) && value){
                for(var r in this.saveData){
                if(r === data){
                    this.saveData[r] = true;
                }
                }
            }else if(reg.test(value) || !value){
                for(var rs in this.saveData){
                if(rs === data){
                    this.saveData[rs] = false;
                }
                }
            }
        },
        //下载pdf
        download(){
            let self = this;
            let data = this.formData;
            console.log(data.state);
            if(data.state === 2){
                console.log(555555555555555555);
                //  let url = 'http://192.168.0.131:8001/register/711Base/downLoad?baseId='+this.$store.get("companyId");
            let url = this.$downloadUrl+'/711Six/downLoad?baseId='+this.$store.get("companyId");
            window.location.href=url;
            }else{
                this.$message.error('有未提交表不能下载');
            }
        },
    }   
    
}
</script>
